package com.zxl.responsibilitychain;

/**
 * @Description: 登录认证handler
 * @Author:zxl
 * @Date: 2023/8/13
 */
public class LoginHandler extends Handler {

    @Override
    public void doHandler(User user) {
        if (!"z3".equals(user.getUserName()) || !"123456".equals(user.getPassWord())) {
            System.out.println("用户名密码不正确");
            return;
        }

        if (null != next) {
            next.doHandler(user);
        }
    }
}